home *** CD-ROM | disk | FTP | other *** search
- /*
- * CSignedDataFile.h
- * Copyright © 1993 Apple Computer Inc.
- * All Rights Reserved
- *
- * This subclass to CDataFile performs file-level
- * Digital Signature processing according to the
- * following model:
- *
- * If the file has a signature, it will be checked
- * and a Failure condition raised if the signature
- * is not verified. If the signature verifies correctly,
- * the signer will be displayed in a Modal Dialog
- * window.
- *
- * To sign a file, your application should execute
- * myFile->SignFileOnClose(TRUE) before closing
- * the file. The signature will be appended when
- * the file is closed.
- */
- #define _H_CSignedDataFile
- #include <DigitalSignature.h>
- #include "CSignature.h"
-
- struct CSignedDataFile : CSignature {
- public:
- void ISignedDataFile(void);
- /*
- * SignFile signs a complete file. Your application
- * must call it in the following sequence:
- * 1. Create a copy of the FSSpec associated with
- * this file.
- * 2. Close the file (this deletes the CDataFile
- * copy of the FSSpec).
- * 3. SignFile
- *
- * The parameters are as follows:
- * signerFile if not NULL, it is a FSSpec
- * defining the signer file. If
- * NULL, SignFile prompts for
- * a signer file (this is normal).
- * promptString The prompt to use when asking
- * for the signer file. Use
- * "\p" for the default prompt.
- * dataFile The file to sign.
- * statusProc Pass NULL for no status window,
- * gSIGStatusProc for a built-in
- * status window, or a pointer to
- * your application's statusProc.
- */
- void SignFile(
- const FSSpec *signerFile,
- ConstStr255Param promptString,
- const FSSpec *dataFile,
- SIGStatusProcPtr statusProc
- );
- /*
- * VerifyFile verifies a complete file. The file
- * may not be open. The parameters are as follows:
- * fileSpec The file to verify.
- * statusProc Pass NULL for no status window,
- * gSIGStatusProc for a built-in
- * status window, or a pointer to
- * your application's statusProc.
- */
- void VerifyFile(
- const FSSpec *fileSpec,
- SIGStatusProcPtr statusProc
- );
- /*
- * FileIsSigned indicates whether a file contains
- * a signature. It does not process the signature.
- * It returns TRUE if it has a signature, FALSE
- * if it does not (error kSIGNoSignature), and
- * fails on other errors.
- */
- Boolean FileIsSigned(
- const FSSpec *fileSpec
- );
- };
-
-